<template>
    <div id="right-bottom-bar" style="width: 100%; height: 485px"></div>
</template>
<script lang="ts">
import { defineComponent, onMounted } from 'vue'

import echarts, { option } from './constant'
import { peopleChange } from '../../constant'

export default defineComponent({
    name: 'RightBottomBar',
    setup() {
        const constant = {
            option
        }
        onMounted(() => {
            let { option } = constant
            option.series[0].data= peopleChange.map((el:any)=>el.newCount)
            option.series[1].data= peopleChange.map((el:any)=>el.back)
            echarts.init(document.getElementById('right-bottom-bar')).setOption(option)
        })
        return {
            ...constant
        }
    }
})
</script>
